# a = {1, 2, 3, 4}
# b = {3, 4, 5, 6}
# # 并集{1, 2, 3, 4, 5, 6}
# union_set = a | b
# # 交集{3, 4}
# intersect_set = a & b
# # 差集{1, 2}   {5, 6}
# diff_a_b = a - b
# diff_b_a = b - a
# # 对称差集{1, 2, 5, 6}
# sym_diff = a ^ b
#
# #给出以上结果
# print(union_set)
# print(intersect_set)
# print(diff_a_b)
# print(diff_b_a)
# print(sym_diff)
#
#
# my_dict = {
#     'name': 'Alice',
#     'age': 25,
#     'job': 'Engineer'
# }



# poem = """
#     岱宗夫如何?齐鲁青未了。
#     造化钟神秀，阴阳割昏晓。
#     荡胸生曾云，决眦入归鸟。
#     会当凌绝顶，一览众山小。
# """
#
# print(poem)

# """
# aaaaaaaaaaaaaaaaaaaaaaaa
# aaaaaaaaaaaaaaaaaaaaaaaa
# """
# age = int(input("请输入年龄:"))
# if age >= 18:
#     print('1')
# else:
#     print('2')

# string = ("Python是一种面向对象、解释型计算机程序设计语言，"
#                "由Guido van Rossum于1989年底发明。"
#                "第一个公开发行版发行于1991年，"
#                "Python源代码同样遵循GPL(GNU General Public License)协议。")
# print(string)

# str1 = "1111"
# str1 = "22222"
# print(str1)


# a = ["1", "2", "3", "2"]
# b = set(a)
# print(b)
#
# a = 239.5
# b = int(a)
# print(b)

# 定义《歌唱祖国》的歌词
# lyrics = """五星红旗迎风飘扬，\n胜利歌声多么响亮；\n歌唱我们亲爱的祖国，"""

# 打印歌词
# with open("D:/lyrics.txt", "w", encoding="UTF-8") as f:
#     print(lyrics, file=f)

# height = float(input())
# weight = float(input())
# BMI = weight/(height * height)
# print(f"{BMI:.2f}")
# result = 5.5 - (2 + 3j)
# print(result)  # 输出: (3.5-3j)
# n = int(input())
# print(n&1)
# a = 7
# b = 4
# c = 9
# p = (a + b + c)*0.5
# s = (p * (p - a) * (p - b) * (p - c)) ** 0.5
# print(f"{s*10:.2f}")

# import wordcloud
# from PIL import Image
# import numpy as np
#
# # 读取图片作为词云形状
# picture = Image.open("./chapter06/douyin.jpeg")
# mk = np.array(picture)
#
# # 读取用于生成词云的文本
# file = open('./chapter06/2023_network_hot_words.txt', encoding='utf-8')
#
# # 创建词云对象，并指定微软雅黑字体
# w = wordcloud.WordCloud(
#     font_path='C:\\Windows\\Fonts\\msyh.ttc',  # 注意这里使用双反斜杠或原始字符串
#     mask=mk,
#     max_words=100,
#     max_font_size=40,
#     background_color='white'
# )
# string = file.read()
# file.close()
#
# # 加载词云文本
# w.generate(string)
#
# # 指定生成图的路径并保存词云图片
# output_path = './chapter06/output_wordcloud.png'
# w.to_file(output_path)

def hanoi(n, ch1, ch2, ch3):
    if n == 1:
        print(f"从把盘子{n}从{ch1}移动到{ch3}")
    else:
        hanoi(n - 1, ch1, ch3, ch2)
        print(f"把盘子{n}从{ch1}移动到{ch3}")
        hanoi(n - 1, ch2, ch1, ch3)

hanoi(3, 'A', 'B', 'C')



